﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfDirectionsList.aspx.cs" Inherits="msBsc.WebUi.wMall.Public.wfDirectionsList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>路线列表</title>
    <link href="/jqPlugin/SelectSimu/css/base.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sLayout.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/Public/sTravel.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/pagination.css" rel="stylesheet" />
    <link href="/jqPlugin/layer2/skin/layer.css" rel="stylesheet" />
    <style>
        #divPage a, #divPage span {
            color: #333;
        }

        .viewContent .v_title {
            display: table;
            padding: 23px 0px;
        }

        .condition_city {
            float: left;
            margin: 20px 5px 0px 5px;
        }

        .v_rountBg {
            width: 1200px;
            height: 610px;
            background: url("/themes/wStyle1/Images/Public/rountBg.png") no-repeat;
            background-size: 1200px 610px;
            display: table;
        }

            .v_rountBg .vr_content {
                float: left;
                width: 898px;
                margin-left: 71px;
            }

            .v_rountBg .vr_more {
                float: left;
                width: 231px;
            }

            .v_rountBg .vr_title {
                width: 898px;
                height: 44px;
                color: #fff;
                line-height: 44px;
                font-family: 微软雅黑;
                margin: 44px auto 0px auto;
            }

                .v_rountBg .vr_title .vrt_name {
                    font-size: 32px;
                    margin-left: 3px;
                    margin-right: 26px;
                    display: inline-block;
                    vertical-align: middle;
                }

                .v_rountBg .vr_title .vrt_city {
                    font-size: 18px;
                    display: inline-block;
                    vertical-align: middle;
                }

                .v_rountBg .vr_title .vrt_j {
                    font-size: 18px;
                    display: inline-block;
                    vertical-align: middle;
                    margin: 0px 6px;
                }

            .v_rountBg .vr_info {
                display: table;
                width: 898px;
                height: 43px;
                margin: 20px auto 0px auto;
                background: url("/themes/wStyle1/Images/Public/rountInfoBg.png") no-repeat;
            }

                .v_rountBg .vr_info .vri_des {
                    float: left;
                    margin-left: 35px;
                    width: 133px;
                    text-align: center;
                    color: #fff;
                    font-family: 微软雅黑;
                    height: 43px;
                    line-height: 43px;
                    font-size: 24px;
                }

                .v_rountBg .vr_info .vri_day {
                    float: left;
                    width: 140px;
                    text-align: left;
                    color: #fff;
                    font-family: 微软雅黑;
                    height: 43px;
                    line-height: 43px;
                    font-size: 24px;
                }

                .v_rountBg .vr_info .vri_one {
                    float: left;
                    width: 580px;
                    display: table;
                    text-align: left;
                    font-family: 微软雅黑;
                    height: 43px;
                    line-height: 43px;
                    font-size: 18px;
                    color: #666;
                }

                    .v_rountBg .vr_info .vri_one .vrio_name {
                        display: inline-block;
                        width: 420px;
                        vertical-align: middle;
                        text-align: left;
                        overflow: hidden;
                    }

                    .v_rountBg .vr_info .vri_one .vrio_shopp {
                        display: inline-block;
                        background: #ff9d00;
                        -moz-border-radius: 3px;
                        -webkit-border-radius: 3px;
                        border-radius: 3px;
                        color: #fff;
                        height: 28px;
                        line-height: 28px;
                        padding-right: 5px;
                        width: 134px;
                        vertical-align: middle;
                    }

                        .v_rountBg .vr_info .vri_one .vrio_shopp .shoppCar {
                            background: url("/themes/wStyle1/Images/Public/shopping.png") no-repeat;
                            display: inline-block;
                            height: 25px;
                            margin: 0px 5px;
                            vertical-align: middle;
                            width: 27px;
                            background-position: 0 -27px;
                        }
    </style>
</head>
<body>
    <div class="head">
        <div class="h_content">
            <div class="hc_login">
                <img src="/themes/wStyle1/Images/comm/log.png" />
            </div>
            <ul class="hc_menu">
                <li class="hcm_check">首页</li>
                <li>热门城市</li>
                <li>美食资讯</li>
                <li>包车资讯</li>
                <li>购物资讯</li>
                <li>司机资讯</li>
                <li class="hcm_yd">提交需求</li>
            </ul>
            <ul class="hc_rmenu">
                <li><a class="hcr_reg">登录</a></li>
                <li class="hc_hr">|</li>
                <li><a class="hcr_reg">注册</a></li>
            </ul>
        </div>
    </div>
    <div class="viewContent">
        <input type="hidden" id="countryId" value="DF6723BE-A25C-4F77-BB49-A1662D3E6F2A" />
        <input type="hidden" id="cityId" value="AEF39D8E-D298-4AF1-AEC5-2B00D237F5F5" />
        <input type="hidden" id="destionId" value="" />
        <input type="hidden" id="pageIndex" value="1" />
        <div class="v_rountBg">
            <div class="vr_content">
                <div class="vr_title" id="titleName">
                    <span class="vrt_name">推荐路线</span>
                    <span class="vrt_city">中国</span>
                    <span class="vrt_j">+</span>
                    <span class="vrt_city">四川</span>
                    <span class="vrt_j">+</span>
                    <span class="vrt_city">九寨沟</span>
                </div>
                <div id="route_list">
                </div>



                <%--<div class="vr_info">
                    <div class="vri_des">马尔代夫</div>
                    <div class="vri_day"><span>一</span>日游</div>
                    <div class="vri_one">
                        <span class="vrio_name">埃菲尔铁塔</span>
                        <a class="vrio_shopp">
                            <em class="shoppCar"></em>
                            加入旅行包
                        </a>
                    </div>
                </div>--%>
            </div>
        </div>
        <div class="jpage" id="divPage"></div>
    </div>
    <%=msBsc.WebUi.Code.QtHtmlGet.GetFloorHtml() %>
    <!--start JS引用-->
    <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script src="/jqPlugin/js/jBase.js"></script>
    <script src="/jqPlugin/js/jBPage.js"></script>
    <script src="/jqPlugin/js/laytpl.js"></script>
    <script src="/themes/wStyle1/js/comm/jsPagination.js"></script>
    <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <script src="/themes/wStyle1/js/travellingBag.js"></script>

    <script src="/jqPlugin/layer2/layer.js"></script>
    <!--end JS引用-->
    <script type="text/javascript">
        var pIndex = 1;
        var country, city, destination;
        (function () {
            //COUNTRY,CITY,DESTINATION
            country = Bag.getRegion("COUNTRY");
            city = Bag.getRegion("CITY");
            destination = Bag.getRegion("DESTINATION");
            if (IsNull(country.id) || IsNull(city.id)) {
                layer.alert("请先选择想去的城市/地区", { icon: 7 });
                return;
            }
            setHtml();
            init(pIndex);
        })()

        function setHtml() {
            var tpl = [];

            tpl.push('<span class="vrt_name">推荐路线</span>');
            tpl.push('<span class="vrt_city">中国</span>');

            tpl.push('<span class="vrt_j">+</span>');
            tpl.push('<span class="vrt_city">' + city.name + '</span>');
            if (!IsNull(destination.id)) {
                tpl.push('<span class="vrt_j">+</span>');
                tpl.push('<span class="vrt_city">' + destination.name + '</span>');
            }

            $("#titleName").html(tpl.join(""));
        };

        //路线添加
        function loadRoutHtml(data, count) {
            var tpl = [];

            $(data.rows).each(function (i, e) {
                var tName = destination.name;
                if (destination.id == "") {
                    tName = city.name;
                }

                tpl.push('<div class="vr_info">');
                tpl.push('<div class="vri_des">' + tName + '</div>');
                tpl.push('<div class="vri_day"><span>' + convertToDay(parseInt(e.ROUTE_BASEINFO_DAYS)) + '</span>日游</div>');
                tpl.push('<div class="vri_one">');
                tpl.push('<span class="vrio_name">' + e.ROUTE_MAIN_SCENICS + '</span>');
                tpl.push('<a class="vrio_shopp" onclick="addBag(\'' + e.ROUTE_BASEINFO_ID + '\')">');
                tpl.push('<em class="shoppCar"></em>加入旅行包</a></div>');
                tpl.push('</div>');
            });

            $("#route_list").html(tpl.join(""));
            jsPage('divPage', count, 8, pIndex, 'init');
        }
        //加入旅行包
        function addBag(routeid) {
            Bag.setRegion("ROUTE", routeid, 1);
            location.href = "/wb_TravelBags.htm";
        }

        //分页
        function init(index) {
            pIndex = index;
            if (IsNull(index)) {
                pIndex = 1;
            }

            var opart = new jsonRow();
            opart.AddCell("parentsId", country.id);
            opart.AddCell("destionId", destination.id);
            opart.AddCell("countryId", city.id);
            opart.AddCell("pIndex", pIndex);
            opart.AddCell("ACTION", "init");
            ajaxComm(opart);
        }

        //天数转换
        function convertToDay(day) {
            switch (day) {
                case 1:
                    return "一";
                case 2:
                    return "二";
                case 3:
                    return "三";
                case 4:
                    return "四";
                case 5:
                    return "五";
                case 6:
                    return "六";
                case 7:
                    return "七";
                case 8:
                    return "八";
                case 9:
                    return "九";
                case 10:
                    return "十";
                default:
                    return "10+";
            }
        }
    </script>
</body>
</html>
